package mapper;

/**
 * @Author:fhx
 * @Date:2024/4/19
 * @Project:BrandWork
 */

import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import pojo.Brand;

public interface BrandMapper {
    @Select({"select * from brand"})
    @ResultMap({"BrandResultMap"})
    List<Brand> selectAll();

    @Insert({"insert into brand values(null,#{brandName},#{companyName},#{ordered},#{description},#{status})"})
    void add(Brand var1);

    void deleteByIds(@Param("ids") int[] var1);

    @Select({"select * from brand limit #{begin} , #{size}"})
    @ResultMap({"BrandResultMap"})
    List<Brand> selectByPage(@Param("begin") int var1, @Param("size") int var2);

    @Select({"select count(*) from brand "})
    int selectTotalCount();

    List<Brand> selectByPageAndCondition(@Param("begin") int var1, @Param("size") int var2, @Param("brand") Brand var3);

    int selectTotalCountByCondition(Brand var1);
}
